package wsz.test;

import org.apache.dubbo.common.extension.ExtensionLoader;
import wsz.service.HelloService;

import java.util.Set;

/**
 * TODO：获取接口所有的扩展信息
 *
 * @author wsz
 * @desc：
 * @date 2021/12/13
 */
public class DubboSpiMain {

    public static void main(String[] args) {
        ExtensionLoader<HelloService> loader = ExtensionLoader.getExtensionLoader(HelloService.class);
        Set<String> supportedExtensions = loader.getSupportedExtensions();
        for (String ex : supportedExtensions) {
            HelloService service = loader.getExtension(ex);
            System.out.println(service.sayHello());
        }
    }
}
